#include <iostream>
#include <memory>
#include <memory>
#include "client.hpp"

using namespace std;


void Usage(const char* program)
{
  cout << "Usage:" << endl;
  cout << "\t" << program << " ServerIP ServerPort" << endl;
}

int main(int argc, char* argv[])
{
  if (argc != 3)
  {
    // 错误的启动方式，提示错误信息
    Usage(argv[0]);
    return 1;
  }

  std::string ip = argv[1];
  uint16_t port = stoi(argv[2]);

  unique_ptr<UdpClient> usvr(new UdpClient(ip, port));

  // 启动客户端
  usvr->StratClient();
  usvr->Join();
  return 0;
}

